﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/admincp.Master" AutoEventWireup="true" CodeBehind="Order.aspx.cs" Inherits="VINETLIFE.AdminCP.Order" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="item-edit-button-box">
        <div class="item-button-inner-left">
            <div class="item-button-inner-left-inner">
                <h4 class="h4-title">Thông tin chi tiết đơn hàng
                </h4>
                <asp:GridView ID="grvOrderDetail" DataKeyNames="id" runat="server" AutoGenerateColumns="False" ShowFooter="true"
                    PageSize="50" CssClass="tstyle2" FooterStyle-CssClass="style2-footer" Width="100%" PagerStyle-CssClass="pgr" AllowPaging="true" OnRowDataBound="grvOrderDetail_RowDataBound">
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="50px" HeaderText="#" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField ItemStyle-Width="50px" HeaderText="Mã đơn hàng" DataField="InvoiceNumber" ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField ItemStyle-Width="200px" HeaderText="Tên sản phẩm">
                            <ItemTemplate>
                                <%#Eval("ProductTitle")%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField ItemStyle-Width="100px" HeaderText="Mã sản phẩm">
                            <ItemTemplate>
                                <%#Eval("ProductCode")%>
                            </ItemTemplate>
                        </asp:TemplateField>

                        <asp:BoundField ItemStyle-Width="50px" HeaderText="Số lượng" DataField="Qty" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField ItemStyle-Width="100px" HeaderText="Giá" DataField="Price" DataFormatString="{0:0,##} đ" ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField ItemStyle-Width="150px" HeaderText="Tổng tiền" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Right">
                            <ItemTemplate>
                                <asp:Literal runat="server" ID="ltrQty" Text='<%#Eval("TotalMoney","{0:0,##} đ")%>'></asp:Literal>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:Label runat="server" ID="lblUnitsInStock"></asp:Label>
                            </FooterTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </div>
            <div class="item-button-inner-left-inner">
                <h4 class="h4-title">Thông tin đơn hàng
                </h4>
                <p>
                    <asp:Label runat="server" ForeColor="Red" ID="lblError"></asp:Label>
                </p>
                <table class="item-button-table-s1">
                    <tr>
                        <td class="ibts1-td1-l">Tên khách hàng</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="300px" CssClass="item-button-input general-input" ID="txtCustomerName" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Mã đơn hàng</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="300px" CssClass="item-button-input general-input t-input-text" ID="txtInvoiceNumber" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Ngày đặt</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="300px" CssClass="item-button-input general-input" ID="txtPurchaseDate" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Ngày yêu cầu</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="300px" CssClass="item-button-input general-input" ID="txtRequired" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>

                    <tr>
                        <td class="ibts1-td1-l">Trạng thái đơn hàng</td>
                        <td class="ibts1-td1-r">
                            <asp:DropDownList runat="server" ID="ddlOrderStatus" DataValueField="TransactionStatusCode" DataTextField="TransactionStatus"></asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Phương thức thanh toán</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="200px" CssClass="item-button-input general-input" ID="txtPaymentMethod" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Sử dụng Ví Vinetlife</td>
                        <td class="ibts1-td1-r">
                            <asp:CheckBox runat="server" Enabled="false" ID="chkIsUseVinetlife" />
                        </td>
                    </tr>
                    <tr runat="server" visible="false" id="trPayedByVinetlife">
                        <td class="ibts1-td1-l">Số tiền đã thanh toán bằng Ví Vinetlife</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="100px" CssClass="item-button-input general-input" ID="txtPayedByVinetlifeAccount" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr runat="server" id="trTransactionId" visible="false">
                        <td class="ibts1-td1-l">Payment transaction</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="100px" CssClass="item-button-input general-input" ID="txtPaypalTransactionId" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Tông tiền</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="100px" CssClass="item-button-input general-input" ID="txtGrandTotal" Enabled="false"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Ghi chú đơn hàng</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="600px" CssClass="item-button-input general-input t-input-text" ID="txtOrderNote" TextMode="MultiLine" Rows="5"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="ibts1-td1-l">Ghi chú lịch sử giao dịch</td>
                        <td class="ibts1-td1-r">
                            <asp:TextBox runat="server" Width="600px" CssClass="item-button-input general-input t-input-text" ID="txtOrderHistoryNote" Height="50px" TextMode="MultiLine" Rows="2"></asp:TextBox>
                        </td>
                    </tr>
                    <tr runat="server" id="trActionComplete" visible="true">
                        <td class="ibts1-td1-l">Action</td>
                        <td class="ibts1-td1-r">
                            <asp:Button ID="btnUpdate" runat="server" ValidationGroup="buttongroup" Text="Cập nhật đơn hàng" OnClick="btnUpdate_Click" CssClass="button-gg-green"></asp:Button>
                            &nbsp;     
                            <asp:Button ID="btnComplete" runat="server" Visible="true" CssClass="button-gg-green" Text="Hoàn tất đơn hàng" OnClick="btnComplete_Click" />
                            &nbsp;    
                            <asp:Button ID="btnCancelOrder" Text="Hủy đơn hàng" runat="server" CausesValidation="False" OnClick="btnCancelOrder_Click" CssClass="button-gg-green"></asp:Button>
                            &nbsp;
                            <asp:Button ID="btnHidden" Text="Ẩn đơn hàng" runat="server" CausesValidation="False" OnClick="btnHidden_Click" CssClass="button-gg-green"></asp:Button>
                            &nbsp;
                            <asp:Button ID="btnDelete" Text="Xóa đơn hàng" runat="server" CausesValidation="False" OnClick="btnDelete_Click" CssClass="button-gg-green"></asp:Button>
                            &nbsp;  
                            <a href="/Admincp/ListOrders.aspx" class="button-gg-green">Danh sách đơn hàng</a>
                        </td>
                    </tr>
                </table>
            </div>

            <div style="float: left; width: 100%; margin: 10px 0;">
                <asp:Repeater runat="server" ID="rptAccountReceivedMoney">
                    <ItemTemplate>
                        <h4 class="h4-title">Tài khoản được nhận % từ hóa đơn này
                        </h4>
                        <table class="item-button-table-s1">
                            <tr>
                                <td class="ibts1-td1-l">Mã khách hàng</td>
                                <td class="ibts1-td1-r">
                                    <asp:TextBox runat="server" Width="150px" CssClass="item-button-input general-input" ID="txtCustomerCode" Enabled="false" Text='<%#Eval("CustomerCode") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="ibts1-td1-l">Họ tên</td>
                                <td class="ibts1-td1-r">
                                    <asp:TextBox runat="server" Width="350px" CssClass="item-button-input general-input" ID="TextBox1" Enabled="false" Text='<%#Eval("FullName") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="ibts1-td1-l">Username</td>
                                <td class="ibts1-td1-r">
                                  <asp:TextBox runat="server" Width="350px" CssClass="item-button-input general-input" ID="TextBox2" Enabled="false" Text='<%#Eval("UserName") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="ibts1-td1-l">Điện thoại</td>
                                <td class="ibts1-td1-r">
                                   <asp:TextBox runat="server" Width="350px" CssClass="item-button-input general-input" ID="TextBox3" Enabled="false" Text='<%#Eval("Phone") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="ibts1-td1-l">Số tiền được nhận</td>
                                <td class="ibts1-td1-r">
                                    <asp:TextBox runat="server" Width="350px" CssClass="item-button-input general-input" ID="TextBox4" Enabled="false" Text=' <%#Eval("ReceivedValue","{0:0,##} đ") %>'></asp:TextBox>
                                </td>
                            </tr>
                        </table>

                    </ItemTemplate>
                </asp:Repeater>
            </div>

            <div class="item-button-inner-left-inner">
                <h4 class="h4-title">Lịch sử thao tác đơn hàng
                </h4>
                <asp:GridView ID="grvOrderHistory" DataKeyNames="OrderHistoryID" runat="server" AutoGenerateColumns="False"
                    PageSize="50" CssClass="tstyle2" FooterStyle-CssClass="style2-footer" Width="100%" PagerStyle-CssClass="pgr" AllowPaging="true" EnableViewState="true">
                    <Columns>
                        <asp:TemplateField ItemStyle-Width="50px" HeaderText="#" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField ItemStyle-Width="150px" HeaderText="Nội dung" DataField="Contents" ItemStyle-HorizontalAlign="Left" />
                        <asp:BoundField ItemStyle-Width="150px" HeaderText="Ngày tạo" DataField="CreateDate" DataFormatString="{0:dd MMM yyyy HH:mm tt}" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField ItemStyle-Width="150px" HeaderText="Username" DataField="UserName" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField ItemStyle-Width="150px" HeaderText="IP" DataField="IP" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField ItemStyle-Width="150px" HeaderText="Ghi chú" DataField="Note" ItemStyle-HorizontalAlign="Center" />
                    </Columns>
                    <EmptyDataTemplate>
                        <div style="float: left; width: 98%; padding: 5px; border: 1px solid #ccc;">Chưa có bản ghi nào</div>
                    </EmptyDataTemplate>
                </asp:GridView>
            </div>
        </div>
        <p>
        </p>
    </div>

</asp:Content>
